Use env var connections instead of mocks in kube system tests#54261
Use env var connections instead of mocks in kube system tests#54261potiuk merged 4 commits intoapache:mainfrom
Conversation
|
@potiuk I think you will like this one :) |
|
nice indeed :) |
|
Ah, had to include the pytest plugin. |
gopidesupavan
left a comment
There was a problem hiding this comment.
cool :) thanks for updating
|
@potiuk getting a clarification here, these tests are separate distros out of providers but use provider code, so do we cherry pick these to v3-0-x branches? |
|
the However - some of the "kubernetes_test" are only using that K8S setup to run "KPO" on running k8s instance (and the fact that that instance was installed to run airflow - does not matter" To be on the safe-side - I'd cherry-pick, also because it makes it easier to cherry-pick changes that should for sure be tested on v3-0-test. |
Yeah i had similar thoughts too regarding this. Let me manually do it |
…ests (#54261) * Use env var connections instead of mocks in kube system tests * adding right pytest plugings * adding right pytest plugings * adding right pytest plugings (cherry picked from commit d410915) Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
|
Heres the cherry pick #54320 |
…#54261) * Use env var connections instead of mocks in kube system tests * adding right pytest plugings * adding right pytest plugings * adding right pytest plugings
…ests (apache#54261) (apache#54320) * Use env var connections instead of mocks in kube system tests * adding right pytest plugings * adding right pytest plugings * adding right pytest plugings (cherry picked from commit d410915)
Why?
While working on #54083, I happened to notice that the kube system tests started failing with:
The reason for this is that those tests used a mock on
get_connectionwhich is mid-way to the entire flow of getting a connection (models connection had an internalget_connectiondefined on connection backends and this test was bypassing it). The currentmock_get_connectionfixture usesmock.patchto return a minimalConnectionobject with onlyconn_idset.A better OR more complete pattern would be to actual create the connection using env vars on the host machine as part of the test setup that runs, that would ensure that no unneccessary mocking is performed and Connection retrieval flow works normally (backend > env > api server)
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.